package com.hp.entity;

import java.io.Serializable;

public class book implements Serializable {
    private int id;
    private String name;
    private double price;
    //生成的代码
    //1.构造方法 至少要生成两个 一个无参的 一个全参的


    public book(int id, String name, double price) {
        this.id = id;
        this.name = name;
        this.price = price;
    }

    public book(String name, double price) {
        this.name = name;
        this.price = price;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "book{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price='" + price + '\'' +
                '}';
    }
}
